package org.jeecg.modules.basic.demo.apartment.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.basic.demo.apartment.entity.LwgyRoomStatistics;
import org.jeecg.modules.basic.demo.apartment.service.ILwgyRoomStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * TODO
 *
 * @author CSD
 * @date 2021-04-27 16:10
 */
@Api(tags = "公寓统计")
@RestController
@RequestMapping("/apartment/LwgyRoomStatistics")
@Slf4j
public class LwgyRoomStatisticsController extends JeecgController<LwgyRoomStatistics, ILwgyRoomStatisticsService> {

    @Autowired
    private ILwgyRoomStatisticsService iLwgyRoomStatisticsService;





    @ApiOperation(value = "根据校区，楼宇，层号获取统计信息")
    @GetMapping(value = "/getStatisticsByApartmentInfo")
    public Result<?>getStatisticsByApartmentInfo(LwgyRoomStatistics iwgyRoomStatistics){
        QueryWrapper<LwgyRoomStatistics> statisticsQueryWrapper = new QueryWrapper<>();
        LwgyRoomStatistics lwgyRoomStatistics = iLwgyRoomStatisticsService.getStatisticList(statisticsQueryWrapper).get(0);
        return Result.OK(lwgyRoomStatistics);

    }

}
